<?php if (!defined('THINK_PATH')) exit();?><html>
    <head>
        <title>产品列表</title>
        <link href="<?php echo (ADMIN_CSS_URL); ?>bootstrap.css" rel="stylesheet" />
        <link href="<?php echo (ADMIN_CSS_URL); ?>lz-style.css" rel="stylesheet" />
        <script src="<?php echo (ADMIN_JS_URL); ?>jquery.js"></script>
        <script src="<?php echo (ADMIN_JS_URL); ?>bootstrap.js"></script>
        <script src="<?php echo (ADMIN_JS_URL); ?>dataTables/jquery.dataTables.js"></script>
        <script src="<?php echo (ADMIN_JS_URL); ?>dataTables/dataTables.bootstrap.js"></script>
        <script src="<?php echo (ADMIN_JS_URL); ?>DatePicker/WdatePicker.js"></script>
        <script>
            $(document).ready(function () {
                $('#dataTables').dataTable({
                    paging: true,
                    searching: false,
                    showrownumber: true
                });
            });
        </script>
    </head>
    <body>
        <div class="container">
            <div class="row div_head" >
                <div class=" col-xs-6 col-sm-6 text-primary">
                    <?php echo ($loction); ?>
                </div>
                <div class=" col-xs-6 col-sm-3"></div>
                <div class=" col-xs-6 col-sm-3">
                    <a style="text-decoration: none;" href="/ecs/index.php/Admin/Product/add">【添加】</a>
                </div>
            </div>
            <hr />
            <div class="row div_form" >
                <form action="/ecs/index.php/Admin/Product/lst" method="post">
<div class="text-right col-xs-6 col-sm-3 " ><label for="ProductCreateDate" class="control-label"><?php echo (LB_PRODUCTCREATEDATE); ?>:</label></div>
                    <div class="col-xs-6 col-sm-3" >
                        <input type="text" id="ProductCreateDate" name="ProductCreateDate" class="form-control Wdate" placeholder="<?php echo (LB_PRODUCTCREATEDATE); ?>" onClick="WdatePicker({el: this, isShowClear: false, readOnly: true, skin: 'whyGreen', dateFmt: 'yyyy/MM/dd'})"  />
                    </div>
<div class="text-right col-xs-6 col-sm-3 " ><label for="ProductCode" class="control-label"><?php echo (LB_PRODUCTCODE); ?>:</label></div>
                    <div class="col-xs-6 col-sm-3 div_text" >
                        <input type="text" id="ProductCode" name="ProductCode" class="form-control" placeholder="<?php echo (LB_PRODUCTCODE); ?>"  value="" maxlength="42"/>
                    </div>
<div class="text-right col-xs-6 col-sm-3 " ><label for="ProductName" class="control-label"><?php echo (LB_PRODUCTNAME); ?>:</label></div>
                    <div class="col-xs-6 col-sm-3 div_text" >
                        <input type="text" id="ProductName" name="ProductName" class="form-control" placeholder="<?php echo (LB_PRODUCTNAME); ?>"  value="" maxlength="100"/>
                    </div>
<div class="text-right col-xs-6 col-sm-3 " ><label for="ProductCategoryId" class="control-label"><?php echo (LB_PRODUCTCATEGORYID); ?>:</label></div>
                    <div class="col-xs-6 col-sm-3 div_text" >
                        <input type="text" id="ProductCategoryId" name="ProductCategoryId" class="form-control" placeholder="<?php echo (LB_PRODUCTCATEGORYID); ?>"  value="" maxlength="42"/>
                    </div>
<div class="text-right col-xs-6 col-sm-3 " ><label for="BrandID" class="control-label"><?php echo (LB_BRANDID); ?>:</label></div>
                    <div class="col-xs-6 col-sm-3 div_text" >
                        <input type="text" id="BrandID" name="BrandID" class="form-control" placeholder="<?php echo (LB_BRANDID); ?>"  value="" maxlength="42"/>
                    </div>
<div class="text-right col-xs-6 col-sm-3 " ><label for="ProductStatus" class="control-label"><?php echo (LB_PRODUCTSTATUS); ?>:</label></div>
                    <div class="col-xs-6 col-sm-3" >
        <select id="ProductStatus" name="ProductStatus" class="form-control" >
            <option value="" style="display: none"></option>
            <?php if(is_array($GV_Enum["ProductStatus"])): foreach($GV_Enum["ProductStatus"] as $k=>$row): ?><option value="<?php echo ($k); ?>"><?php echo ($k); ?>-<?php echo ($row); ?></option><?php endforeach; endif; ?>
        </select>
                    </div>



                    <div class="col-xs-6 col-sm-3">
                        <input type="submit" id="search"  class="btn btn-default" value="查询">
                    </div>

                </form>
                <div id="error" class="row text-danger"></div>
                <div id="success" class="row text-success"></div>
            </div>
            <hr />
            <div class="row div_content" >
                <div class="col-md-12">
                    <div class="table-responsive">
                        <table class="table table-striped table-bordered table-hover table-condensed" id="dataTables" border="1">
                            <thead>
                                <tr>
                                    <th class="div_tab_head">序号</th>

                    <th class="div_tab_head"><?php echo (LB_PRODUCTCODE); ?></th>

                    <th class="div_tab_head"><?php echo (LB_PRODUCTNAME); ?></th>

                    <th class="div_tab_head"><?php echo (LB_BASEPRICE); ?></th>

                    <th class="div_tab_head"><?php echo (LB_PRODUCTCATEGORYID); ?></th>

                    <th class="div_tab_head"><?php echo (LB_BRANDID); ?></th>

                    <th class="div_tab_head"><?php echo (LB_PRODUCTIMG); ?></th>

                    <th class="div_tab_head"><?php echo (LB_PRODUCTSIMG); ?></th>

                    <th class="div_tab_head"><?php echo (LB_PRODUCTSTATUS); ?></th>

                                    <th class="div_tab_head">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            <?php if(is_array($lst)): foreach($lst as $key=>$row): ?><tr>
                                    <td class="div_tab_cell"><?php echo ($key+1); ?></td>
                    <td class="div_tab_cell div_tab_cell_text"><?php echo (stripcslashes($row["productcode"])); ?></td>
                    <td class="div_tab_cell div_tab_cell_text"><?php echo (stripcslashes($row["productname"])); ?></td>
                    <td class="div_tab_cell div_tab_cell_num"><?php echo (stripcslashes($row["baseprice"])); ?></td>
                    <td class="div_tab_cell div_tab_cell_text"><?php echo (stripcslashes($row["productcategoryid"])); ?></td>
                    <td class="div_tab_cell div_tab_cell_text"><?php echo (stripcslashes($row["brandid"])); ?></td>
                    <td class="div_tab_cell div_tab_cell_text"><?php echo (stripcslashes($row["productimg"])); ?></td>
                    <td class="div_tab_cell div_tab_cell_text"><?php echo (stripcslashes($row["productsimg"])); ?></td>
                    
<?php $var_productstatus = $row["productstatus"]; ?>
<td class="div_tab_cell div_tab_cell_text"><?php echo (stripcslashes($GV_Enum["ProductStatus"]["$var_productstatus"])); ?></td>

                                    <td align="center" class="div_tab_cell"><div class="btn-group">
                                            <a id="edit" type="button" class="btn btn-default" href="/ecs/index.php/Admin/Product/edit/ProductCode/<?php echo ($row["productcode"]); ?>"><span class="glyphicon glyphicon-pencil"></span></a>
                                            <a id="delete" type="button" class="btn btn-default"href="/ecs/index.php/Admin/Product/del/ProductCode/<?php echo ($row["productcode"]); ?>" onClick="if (confirm('确定要删除吗？'))
                                                        return true;
                                                    else
                                                        return false;"><span class="glyphicon glyphicon-remove"></span></a>
                                        </div></td>
                                </tr><?php endforeach; endif; ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>

    </body>
</html>